import { EExceptionStatusCode, IException } from '@/types/common'

// 用户校验 异常类
export default class UserAuthError extends Error implements IException {
  // 状态码
  public statusCode: EExceptionStatusCode

  // 构造函数 默认状态码为 401 未登录
  constructor(
    message: string = '用户未登录，请先登录',
    statusCode: EExceptionStatusCode = EExceptionStatusCode.UNAUTHORIZED
  ) {
    super(message)
    this.statusCode = statusCode
    this.name = 'AuthenticateFailError'
  }
}
